
export default {
	data() {
		return {
			
		}
	},
	created(){
		/*
		* //初始化时，调用方法获取到父元素实例
		* */
		this.popup = this.getParent()
	},
	methods:{
		/**
		 * 获取父元素实例
		 */
		getParent(name = 'uniPopup') {
			let parent = this.$parent;
			/*
			* // 声明parentName为父元素实例的name
			* */
			let parentName = parent.$options.name;
			/*
			* // 条件判断传入的name和声明的parentName是否相等，传入name默认值为uniPopup
			* */
			while (parentName !== name) {
				parent = parent.$parent;
				if (!parent) { return false; }
				parentName = parent.$options.name;
			}
			return parent;
		},
	}
}
